Skip to content

feat: migrate service account ot use 1Password sdk#137

Open
JillRegan wants to merge 22 commits intomainfrom
feature/migrate-to-sdk
Open

feat: migrate service account ot use 1Password sdk#137
JillRegan wants to merge 22 commits intomainfrom
feature/migrate-to-sdk

Conversation

@JillRegan
Copy link

@JillRegan JillRegan commented Feb 20, 2026

This PR migrates service account secret resolution in load-secrets-action from the CLI to the 1Password SDK. The action now selects the backend based on configuration:

  • Connect: continue using the 1Password CLI (and only install the CLI in this case).
  • Service account (OP_SERVICE_ACCOUNT_TOKEN): resolve op://... references via the 1Password SDK. -> This is new

Changes

  • Adds @1password/sdk as a dependency.
  • Validates secret references up front using Secrets.validateSecretReference, failing with clearer errors when refs are invalid.
  • Expands unit tests to cover the new service-account/SDK path (single + multiple refs, export-env behavior, validation, and error handling).
  • Extends e2e workflow coverage with a test ensuring an invalid secret reference fails as expected.

⚠️ The changes in this PR have been previously reviewed, as this is the feature branch.
Reviewed in these PRs: #135, #134

Tests:

To test these changes I created a branch with updates to the update the dist/ folders by running npm run build:all

Branch is here: https://github.com/1Password/load-secrets-action/tree/jill/rebuild-dist

I then created an action in another repo which uses this branch to load secrets and opened a PR. You can see here that both jobs for Service account and Connect ran and were able to load the secrets.

The CLI was not installed for Service Account but was Installed for Connect.

image image

I will wait until we handle to release PR to build the dist files from main once this is merged.

@JillRegan JillRegan changed the title [DRAFT] feat: deprecate cli and migrate to sdk [DRAFT] feat: migrate service account ot use 1Password sdk Feb 26, 2026
@JillRegan JillRegan changed the title [DRAFT] feat: migrate service account ot use 1Password sdk feat: migrate service account ot use 1Password sdk Feb 26, 2026
@JillRegan JillRegan marked this pull request as ready for review February 26, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant